import React from 'react'
import {Table} from 'antd'
import '@/assets/less/groupshow.less'
function GroupShow(props) {
  let { group, data } = props
  data.map((item,index)=>{
    item["order"] = index+1
    item['key'] = index
    return item
  })
  let title=""
  let index = ""
  switch (group) {
    case "按照车牌分组":
      title="车牌"
      index ="plate_number"
      break;
  
    case "按照点位分组":
      title = "点位"
      index = "point"
      break;
  
    case "按照车辆品牌分组":
      title = "车辆品牌"
      index = "vehicle_type"
      break;
  
    default:
      break;
  }
  const columns = [
    {
      title: "序号",
      dataIndex: "order",
      key: "order",
    },
    {
      title: `${title}`,
      dataIndex: `${index}`,
      key: `${index}`,
    },
    {
      title: '数量',
      dataIndex: 'count',
      key: 'count',
      render: (text) =><a>{text}</a>
    }]
  return (
   <div className='group_content'>
      <Table
        columns={columns}
        dataSource={data}
        pagination={false}
        bordered
        size='small'
        style={{width:"800px"}}
        rowClassName="row_style"
       />
   </div>
  )
}

export default GroupShow
